import request from '@/utils/request'

/**
 * 查询所有工单列表
 * @returns {AxiosPromise}
 */
export function findWorkList() {
  return request({
    url: '/report?action=&type=',
    method: 'get'
  })
}

/**
 * 根据Id查询工单
 * @param id
 * @returns {AxiosPromise}
 */
export function findWorkById(id) {
  return request({
    url: '/report/'+id,
    method: 'get',
  })
}
/**
 * 根据设备Id查询工单列表
 * @param id
 * @returns {AxiosPromise}
 */
export function findWorkByEquipmentId(id) {
  return request({
    url: '/report?action=byEquipment&type=&equipment_id='+id,
    method: 'get',
  })
}

/**
 * 根据id删除工单
 * @param id
 * @returns {AxiosPromise}
 */
export function deleteWork(id) {
  return request({
    url: '/report/'+id,
    method: 'delete',
  })
}

